import request from '@/utils/request'

export interface cartListModel {
    cartInfoList: cartInfoListModel[],
    activityRuleList: null,
    createTime: string
}

export interface cartInfoListModel {
    id: number,
    userId: string,
    skuId: number,
    cartPrice: number,
    skuNum: number,
    imgUrl: string,
    skuName: string,
    isChecked: number,
    createTime: string,
    operateTime: string,
    isOrdered: number,
    orderTime: null,
    sourceType: string,
    sourceId: number,
    skuPrice: number,
    couponInfoList: null
}

export default {
    // 获取购物车列表
    reqCartList()  {
        return request.get<any, cartListModel[]>(`/cart/cartList`)
    }
    // 添加购物车接口(对已有商品进行数量修改)
    // reqToCart (skuId, skuNum)  {
    //     return request.post(`/cart/addToCart/${ skuId }/${ skuNum }`)
    // }
}